package com.qianfeng.tiantian_banjia.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class NetUtils {
	private static ConnectivityManager manager;
	public static boolean isConnection(Context context){
		manager=(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo networkInfo=manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
		NetworkInfo wifiworkInfo=manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
		if((networkInfo!=null&&networkInfo.isConnected())||(wifiworkInfo!=null&&wifiworkInfo.isConnected())){
			return true;
		}
		
		return false;
		
	}

}
